package com.haust.su.ghyy.cmn.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;

/**
 * @author haustsusu
 * @create 2023-02-13-14:14
 */
@Configuration
@MapperScan("com.haust.su.ghyy.cmn.mapper")
public class CmnConfig {

    //分页插件
    //@Bean
    //public PaginationInterceptor paginationInterceptor(){
    //    return new PaginationInterceptor();
    //}

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
        return interceptor;
    }


}
